// ****************************************************************************
//
// Logic 2: First room
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(37);

  // The next 6 lines need only be in the first room of the game
  if ((prev_room_no == 2 ||    // just come from intro screen
      prev_room_no == 0)) {    // or just started game
    position(ego,90,130);
    status.line.on();
    accept.input();
    }

// Check what room the player came from and position them on the
// screen accordingly here, e.g:
// if (prev_room_no == 5) {
//   position(ego,12,140);
// }

  draw(ego);
  show.pic();

 set(f100);
 set(f101);
  }
animate.obj(o3);
load.view(100);
set.view(o3,100);
set.loop(o3,1);
set.cel(o3,0);
position(o3,110,130);
draw(o3);
stop.cycling(o3);

if((f100) && (f94)){
print("%s1, my boy. Come here. Do you want to learn your first spell?");
reset(f100);
reset(f94);
}
if((said("y"))&&(f101)){
new.room(2);
reset(f101);
}
if(said("n")){
print("Then you do not wish to be a wizard. Goodbye.");
quit(1);
}
if(f92){
print("Right, %s1. Now you must go and train at the Rethoc forest Training Zone.");
print("Here is your first wand. It is a Grade 1 wand and will only cast spells in the first circle of magic.");
print("How well you do in training will affect the amount of mana, strength and your health you have.");
print("Go now and do not return until the task is done.");
get("Magic Wand Grade 1");
new.room(4);
}
if(said("look")) {
  print("This is Lewelto's laboratory.");
  print("There is a desk and some shelves at the back, a table at the front and some more shelves on the right wall.");
  print("You feel a stange magical aura around this place.");
}

if (ego_edge_code == horizon_edge) {  // ego touching horizon
  new.room(2);
}

if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(2);
}

if (ego_edge_code == bottom_edge) {   // ego touching bottom edge of screen
  new.room(2);
}

if (ego_edge_code == left_edge) {     // ego touching left edge of screen
  new.room(2);
}

return();